local sk__baozheng = fk.CreateSkill {

  name = "sk__baozheng",

  tags = { Skill.Compulsory, },

}



sk__baozheng:addEffect(fk.EventPhaseEnd, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target ~= player and player:hasSkill(sk__baozheng.name) and target.phase == Player.Draw and not target.dead
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:doIndicate(player.id, {target.id})
    if target:isKongcheng() then
      room:useVirtualCard("slash", nil, player, target, sk__baozheng.name, true)
    else
      local card = room:askForCard(target, 1, 1, false, sk__baozheng.name, true, ".|.|.|.|.|trick", "#sk__baozheng-invoke:"..player.id)
      if #card > 0 then
        room:moveCardTo(card, Card.PlayerHand, player, fk.ReasonGive, sk__baozheng.name, nil, true, target)
      else
        room:useVirtualCard("slash", nil, player, target, sk__baozheng.name, true)
      end
    end
  end,
})

return sk__baozheng